#include"Sort.h"
void ArrPrint(int* arr, int n)
{
	for (int i = 0; i < n; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}
void Swap(int* p1, int* p2)
{
	int tmp = *p1;
	*p1 = *p2;
	*p2 = tmp;
}
void AddJustDowm(int* arr,int n,int parent)
{
	int chile = (parent * 2) + 1;
	while (chile<n)
	{
		if (chile < n-1 && arr[chile] < arr[chile + 1])
		{
			chile++;
		}
		if (arr[chile] > arr[parent])
		{
			Swap(&arr[chile], &arr[parent]);
			parent = chile;
			chile = (parent * 2) + 1;
		}
		else
		{
			break;
		}
	}

}
